<!--@reference Agile Web Development with Rails (4th Edition) (Whitney, Clare x11106131)
-->

<h1>Listing orders</h1>

<table>
  <tr>
    <th>Name</th>
    <th>Address</th>
    <th> email</th>
    <th>Pay type</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @orders.each do |order| %>
  <tr>
    <td><%= order.name %></td>
    <td><%= order.address %></td>
    <td><%= order. email %></td>
    <td><%= order.pay_type %></td>
    <td><%= link_to 'Show', order %></td>
    <td><%= link_to 'Edit', edit_order_path(order) %></td>
    <td><%= link_to 'Destroy', order, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Order', new_order_path %>
